/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.language2;

import java.io.IOException;
import java.util.Collection;
import java.util.LinkedList;

import ac.jp.u_tokyo.SyncLib.language.EvaluationFailedException;
import ac.jp.u_tokyo.SyncLib.language.Program;

public class HigherProgram
{
	private Collection<HigherSyncDecl> _decls = new LinkedList<HigherSyncDecl>();
	private Program _program = new Program();
	
	public void addDecl(HigherSyncDecl decl) {
		_decls.add(decl);
	}
	
	Program getLowerProgram() {
		return _program;
	}
	
	public Program compile() throws EvaluationFailedException {
		for(HigherSyncDecl decl : _decls) {
			_program.addSyncDecl(decl.getName(), decl.getResult());
		}
		return _program;
	}
	

}
